package ${basePackage}.maker.cli.command;

import java.util.concurrent.Callable;

import ${basePackage}.maker.entity.DataModel;
import .maker.generator.MainGenerator;

import cn.hutool.co${basePackage}re.bean.BeanUtil;
import lombok.Data;
import picocli.CommandLine;

/**
 * @author Administrator
 */
@Data
@CommandLine.Command(name = "generate", version = "${version}", mixinStandardHelpOptions = true)
public class GenerateCommand implements Callable<Integer> {

    <#list models! as model>
    @CommandLine.Option(names = {"-${model.abbr}", "--${modelfieldName}"}, arity = "0..1", interactive = true, echo = true,description = "${model.description}")
    private ${model.type} ${model.fieldName} = ${model.defaultValue?c};
    </#list>

    @Override
    public Integer call() {
        DataModel config = new DataModel();
        BeanUtil.copyProperties(this, config);
        MainGenerator.doGenerate(config);
        return 0;
    }
}
